package com.yugao.fintech.antelope.pay.payment.model;

import com.yugao.fintech.antelope.pay.model.rqrs.pay.AbstractRS;
import com.yugao.fintech.framework.assistant.utils.exception.BizException;

/***
 * api响应结果构造器

 */
public class ApiResBuilder {

    /**
     * 构建自定义响应对象, 默认响应成功
     */
    public static <T extends AbstractRS> T buildSuccess(Class<? extends AbstractRS> t) {

        try {
            return (T) t.getDeclaredConstructor().newInstance();

        } catch (Exception e) {
            throw new BizException("响应结果构造失败");
        }
    }

}
